package cn.su.service.impl;

import cn.su.dao.impl.providerDaoimpl;
import cn.su.dao.providerDao;
import cn.su.pojo.provider;
import cn.su.service.providerService;

import java.util.List;

public class providerServiceimpl  implements providerService {

    @Override
    public List<provider> provider_List() {
        providerDao providerdao = new providerDaoimpl();
        List<provider> providers = providerdao.provider_List();
        return providers;
    }

    @Override
    public List<provider>  provider_search(String queryProCode, String queryProName) {
          providerDao providerDao=new providerDaoimpl();
        List<provider>  provider = providerDao.provider_search(queryProCode,queryProName);
        return provider;
    }

    @Override
    public int provider_add(provider provider) {
        providerDao providerDao=new providerDaoimpl();
        int i = providerDao.provider_add(provider);
        return i;
    }
    public provider provider_chakan(int id) {//根据id查看供货商
       providerDao providerDao=new providerDaoimpl();
        provider provider = providerDao.provider_chakan(id);
        return  provider;

    }
    public  int provider_update(int id,provider provider){
        providerDao providerDao=new providerDaoimpl();
        int i = providerDao.provider_update(id, provider);
        return i;
    }
    public  int provider_delete(int id){
        providerDao providerDao=new providerDaoimpl();
        int i = providerDao.provider_delete(id);
        return i;
    }



}
